{
strcpy (cname, name);
name = cname;
+
+ if ((model = babl_db_exist_by_name (babl_model_db (), name)))
+ {
+ cname[0] = ')';
+ if (format_u8)
+ *format_u8 = babl_db_exist_by_name (babl_format_db (), name);
+ cname[0] = '\\';
+ if (format_u8_with_alpha)
+ *format_u8_with_alpha = babl_db_exist_by_name (babl_format_db (), name);
+ return model;
+ }
}
/* re-registering is a no-op */
*palptr = default_palette ();;
cname[0] = 'v';
model_no_alpha = babl_model_new ("name", name, component, NULL);
- cname[0] = 'x';
+ cname[0] = '\\';
f_pal_a_u8 = (void*) babl_format_new ("name", name, model,
babl_type ("u8"),
component, alpha, NULL);
- cname[0] = 'y';
+ cname[0] = ')';
f_pal_u8 = (void*) babl_format_new ("name", name, model_no_alpha,
babl_type ("u8"),
component, NULL);
/**
* create a new palette based format, name is optional pass in NULL to get
* an anonymous format. If you pass in with_alpha the format also gets
- * an 8bit alpha channel. Returns the BablModel of the color model.
+ * an 8bit alpha channel. Returns the BablModel of the color model. If
+ * you pass in the same name the previous formats will be provided
+ * again.
*/
const Babl *babl_new_palette (const char *name,
const Babl **format_u8,